package com.qf.day09;

import com.qf.day07.Animal;

public class ZangAo extends Animal {

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ZangAo() {
    }


    @Override
    public int compareTo(Animal o) {
        if (o instanceof ZangAo){
           return  this.getName().compareTo(((ZangAo) o).getName());
        }
        return 0;
    }

    public ZangAo(String type, int age, String sex, String name) {
        super(type, age, sex);
        this.name = name;
    }


    public void cry(){
        System.out.println(this.getName()+"正在叫");
    }
}
